﻿#pragma once
#include "AnalyseTree.h"


/*中间特殊结点*/
class AnalyseTreeNodeCondition_custom_tooltip : public AnalyseTreeNodeCondition
{
public:
	AnalyseTreeNodeCondition_custom_tooltip(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	void SetData(std::wstring wstr) { m_wstr_text = wstr; }
private:
	std::wstring m_wstr_text;
public:
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
	bool InsertNode(std::unique_ptr<AnalyseTreeNodeCondition> pNode);
private:
	std::unique_ptr<AnalyseTreeNodeCondition> m_pNodeCondition_hidden_tooltip;

};

class AnalyseTreeNodeCondition_hidden_tooltip : public AnalyseTreeNodeConditionAND
{
public:
	AnalyseTreeNodeCondition_hidden_tooltip(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeConditionAND(pFather) {}
};

class AnalyseTreeNodeCondition_OtherTitle : public AnalyseTreeNodeCondition	// "k_moravia" : { "has_holder" : false }
{
public:
	AnalyseTreeNodeCondition_OtherTitle(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	void SetData(std::wstring wstr) { m_wstr_Title = wstr; }
private:
	std::wstring m_wstr_Title;	// 可转化成头衔
public:
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
	bool InsertNode(std::unique_ptr<AnalyseTreeNodeCondition> pNode);
private:
	std::unique_ptr<AnalyseTreeNodeCondition> m_pChildNode;
};

class AnalyseTreeNodeCondition_FROM : public AnalyseTreeNodeCondition_OtherTitle		// FROM = this title
{
public:
	AnalyseTreeNodeCondition_FROM(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition_OtherTitle(pFather) {}
};

class AnalyseTreeNodeCondition_any_previous_holder : public AnalyseTreeNodeCondition	// 所有的前任持有者
{
public:
	AnalyseTreeNodeCondition_any_previous_holder(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;		// 省份指针通过AnyData传进来
	bool InsertNode(std::unique_ptr<AnalyseTreeNodeCondition> pNode);
private:
	std::unique_ptr<AnalyseTreeNodeCondition> m_pChildNode;
};

class AnalyseTreeNodeCondition_any_realm_province : public AnalyseTreeNodeCondition	// 下辖法理省份
{
public:
	AnalyseTreeNodeCondition_any_realm_province(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
	bool InsertNode(std::unique_ptr<AnalyseTreeNodeCondition> pNode);
private:
	std::unique_ptr<AnalyseTreeNodeCondition> m_pChildNode;
};

class AnalyseTreeNodeCondition_OtherProvince : public AnalyseTreeNodeCondition	// "774" : {}  Jerusalem
{
public:
	AnalyseTreeNodeCondition_OtherProvince(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
	bool InsertNode(std::unique_ptr<AnalyseTreeNodeCondition> pNode);
private:
	std::unique_ptr<AnalyseTreeNodeCondition> m_pChildNode;
};

class AnalyseTreeNodeCondition_owner : public AnalyseTreeNodeCondition
{
public:
	AnalyseTreeNodeCondition_owner(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
	bool InsertNode(std::unique_ptr<AnalyseTreeNodeCondition> pNode);
private:
	std::unique_ptr<AnalyseTreeNodeCondition> m_pChildNode;
};



/*尾部特殊结点*/
class TailNodeCondition_always : public AnalyseTreeNodeCondition	// 恒为真或假
{
public:
	TailNodeCondition_always(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	void SetData(bool b) { m_b_always = b; }
private:
	bool m_b_always;
public:
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_ai : public AnalyseTreeNodeCondition	// 创建者是否是AI
{
public:
	TailNodeCondition_ai(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_year : public AnalyseTreeNodeCondition
{
public:
	TailNodeCondition_year(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_religion : public AnalyseTreeNodeCondition
{
public:
	TailNodeCondition_religion(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_religion_group : public AnalyseTreeNodeCondition
{
public:
	TailNodeCondition_religion_group(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_culture : public AnalyseTreeNodeCondition
{
public:
	TailNodeCondition_culture(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_culture_group : public AnalyseTreeNodeCondition
{
public:
	TailNodeCondition_culture_group(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_has_holder : public AnalyseTreeNodeCondition	// 是否被持有
{		
public:
	TailNodeCondition_has_holder(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};

class TailNodeCondition_is_republic : public AnalyseTreeNodeCondition	// 是否是共和国
{
public:
	TailNodeCondition_is_republic(AnalyseTreeNodeCondition*& pFather) : AnalyseTreeNodeCondition(pFather) {}
	bool DoExecute(const AnyData& input, std::wstring& wstrDescription) const;
};
